package com.project.webpage.controller;


import com.github.pagehelper.PageInfo;
import com.project.webpage.aop.TagLog;
import com.project.webpage.dto.ShCzJzParam;
import com.project.webpage.dto.ShCzRfidParam;
import com.project.webpage.service.CzjczRfidStateService;
import com.project.webpage.util.RestResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/webpage/czjcz/rfid/")
public class CzjczRfidStateController extends BaseController {

    @Resource
    CzjczRfidStateService czjczRfidStateService;

    /**
     * 列表查询
     */
    @PostMapping("state/page")
    @TagLog(operation = 0, content = "查询RFID链路数据列表")
    public RestResult page(@RequestBody ShCzJzParam param) {
        this.getPage(true, param);
        return RestResult.ok(new PageInfo<>(czjczRfidStateService.getJzListForPage(param)));
    }

    /**
     * 导出列表
     */
    @PostMapping("state/output")
    @TagLog(operation = 5, content = "导出RFID链路数据列表")
    public RestResult output(@RequestBody ShCzRfidParam param) {
        this.getPage(false, param);
        return RestResult.ok(czjczRfidStateService.getRfidListForPage(param));
    }
}
